package com.taxshare.purchaser.controller;

import com.taxshare.mybatis.pager.PageRequest;
import com.taxshare.purchaser.entity.TollTicketEntity;
import com.taxshare.purchaser.service.TollTicketCollectService;
import com.taxshare.purchaser.view.dto.TollTicketDTO;
import com.taxshare.response.beans.Response;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author YANG
 * @date 2021/4/9
 */
@RestController
@RequestMapping("/tollTicketCollect")
@Api(tags = "过路费发票采集")
public class TollTicketCollectController {

    @Autowired
    TollTicketCollectService tollTicketCollectService;

    @PostMapping("/query")
    @ApiOperation(value = "过路费发票查询", notes = "发票采集")
    public Response<TollTicketEntity> queryTollTicket(@RequestBody PageRequest<TollTicketDTO> query) {
        return tollTicketCollectService.queryTaxiTicket(query);
    }

    @PostMapping("/delete")
    @ApiOperation(value = "过路费发票删除", notes = "发票采集")
    public Response tollTicketDelete(@RequestBody TollTicketDTO tollTicketDTO) {
        return tollTicketCollectService.tollTicketDelete(tollTicketDTO);
    }

    @PostMapping("/personLiable")
    @ApiOperation(value = "责任人、记账科目、授权报销设置", notes = "未报销")
    public Response personLiable(@RequestBody TollTicketDTO tollTicketDTO) {
        return tollTicketCollectService.personLiable(tollTicketDTO);
    }

    @PostMapping("/submit")
    @ApiOperation(value = "提交报销", notes = "未报销")
    public Response submitReimbursement(@RequestBody TollTicketDTO tollTicketDTO) {
        return tollTicketCollectService.submitReimbursement(tollTicketDTO);
    }

    @PostMapping("/applicationRejected")
    @ApiOperation(value = "申请驳回", notes = "已报销")
    public Response applicationRejected(@RequestBody TollTicketDTO tollTicketDTO) {
        return tollTicketCollectService.applicationRejected(tollTicketDTO);
    }
}
